<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>参数传递</title>
</head>
<body>
    <div id="app">
        <h3>{{name}}</h3>
        <h3>{{age}}</h3>
        <button @click="change('法外狂徒-张三','20')">点击更改</button>
    </div>
</body>
</html>
<script src="./js/2.7.14_dist_vue.js"></script>
<script>
    new Vue({
        el:"#app",
        data:{
            name:"张三",
            age:18,
        },
        methods: {
            change(name,age){
                this.name=name;
                this.age=age;
            },
        },
    });
</script>